﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Masuit.Tools.Logging;
using Masuit.Tools.Reflection;

namespace testThirdLib
{
    class Program
    {
        static void Main(string[] args)
        {

            RabbitMQTest rmqt = new RabbitMQTest();
            //rmqt.sendMsg();
            rmqt.receiveMsg();
            


            //// 日志文件的路径
            //LogManager.LogDirectory = AppDomain.CurrentDomain.BaseDirectory + "/logs";
            //LogManager.Event += info =>
            //{
            //    //todo:注册一些事件操作
            //};

            // // 写日志
            // LogManager.Info("记录一次消息");
            // LogManager.Error(new Exception("异常消息"));
            // LogManager.Info("这是一个日志");

            //Rectangle r1 = new Rectangle();
            //r1.Width = 45;
            //r1.Length = 78;
            //ReflectionUtil.SetField<Rectangle>(r1, "width", 25.0);
            //ReflectionUtil.SetField<Rectangle>(r1, "length", 4.0);
            //ReflectionUtil.InvokeMethod(r1, "Display",new object[]{});


            //System.Reflection.FieldInfo[] fieldInfos = ReflectionUtil.GetFields(r1);
            //Console.WriteLine(fieldInfos.Length);
            //foreach (System.Reflection.FieldInfo fieldInfo in fieldInfos)
            //{
            //    Console.WriteLine(fieldInfo.Name);
            //    Console.WriteLine(fieldInfo.FieldType);
            //    //Console.WriteLine(fieldInfo.GetType());
            //}

            //Console.ReadKey();
        }
    }

    class Rectangle
    {
        // 成员变量
        protected double length;
        protected double width;

        public Rectangle()
        {

        }

        public Rectangle(double l, double w)
        {
            length = l;
            width = w;
        }

        public double Length
        {
            get
            {
                return length;
            }
            set
            {
                length = value;
            }
        }

        public double Width
        {
            get
            {
                return width;
            }
            set
            {
                width = value;
            }
        }

        public double GetArea()
        {
            return length * width;
        }
        public void Display()
        {
            Console.WriteLine("Length: {0}", length);
            Console.WriteLine("Width: {0}", width);
            Console.WriteLine("Area: {0}", GetArea());
        }
    }//end class Rectangle
}
